<template>
  <div class="container">
    <div class="fixed-sidebar">
      <!-- 固定的左边信息栏内容 -->
      <form-dialog2
        v-model="showDialogs1"
        @submits1="handleSubmits1"
        :parentDatas1="messages1"
      ></form-dialog2>
      <form-dialog4
        v-model="showDialogse1"
        @submitse1="handleSubmitse1"
        :parentDatase1="messagese1"
        ref="FormDialog1"
      ></form-dialog4>
      <form-dialog4
        v-model="showDialogse2"
        @submitse2="handleSubmitse2"
        :parentDatase2="messagese2"
        ref="FormDialog2"
      ></form-dialog4>
      <form-dialog4
        v-model="showDialogse3"
        @submitse3="handleSubmitse3"
        :parentDatase3="messagese3"
        ref="FormDialog3"
      ></form-dialog4>
      <form-dialog4
        v-model="showDialogse4"
        @submitse4="handleSubmitse4"
        :parentDatase4="messagese4"
        ref="FormDialog4"
      ></form-dialog4>
      <form-dialog5
        v-model="showDialogse5"
        @submitse5="handleSubmitse5"
        :parentDatase5="messagese5"
        ref="FormDialog5"
      ></form-dialog5>
      <div class="sidebar-content1">
        <div class="s-title">
          <img
            class="mmg"
            src="../../assets/images/icon_h1h6rlt6v8d/zuojiantou7.png"
            mode=""
            @click="imaged"
          />
          <h5>基本信息</h5>
          <div>
            <img
              src="../../assets/images/b79031a7b47c874c055f474e1d48be4970f24ed6252e-RU07Ix.png"
              alt=""
              class="img1"
              @click="set"
            />
            <img
              src="../../assets/images/微信图片_20240521231143.png"
              alt=""
              class="img1"
              @click="showDialogs1 = true"
            />
          </div>
        </div>
        <div>
          <div class="t1">
            <p>姓名:</p>
            <p>{{ this.user.xqlist1.Pson_Name }}</p>
          </div>
          <div class="t1">
            <p>性别:</p>
            <p>{{ this.user.xqlist1.Pson_Sex }}</p>
          </div>
          <div class="t1">
            <p>年龄:</p>
            <p>{{ this.user.xqlist1.Pson_Age }}</p>
          </div>
          <div class="t1">
            <p>身份证:</p>
            <p>{{ this.user.xqlist1.Pson_CardID }}</p>
          </div>
          <div class="t1" v-if="this.user.xqlist1.Pson_Tel">
            <p>手机号:</p>
            <p>{{ this.user.xqlist1.Pson_Tel }}</p>
          </div>
          <div class="t1">
            <p>体检编号:</p>
            <p>{{ this.user.xqlist1.Check_No }}</p>
          </div>
          <div class="t1">
            <p>体检日期:</p>
            <p>{{ this.user.xqlist1.Check_Date }}</p>
          </div>
          <div class="t1">
            <p>人群类型:</p>
            <p>{{ this.user.xqlist1.Pson_Type }}</p>
          </div>
        </div>
      </div>
      <div class="sidebar-content2">
        <div class="content2-nent">
          <div class="t1">
            <p>身高:</p>
            <p>{{ this.user.Get_CheckSub_Data.Sub_Height }}</p>
          </div>
          <div class="t1">
            <p>体重:</p>
            <p>{{ this.user.Get_CheckSub_Data.Sub_Weight }}</p>
          </div>
          <div class="t1">
            <p>BMI值:</p>
            <p>{{ this.user.Get_CheckSub_Data.Sub_Bmi }}</p>
          </div>
          <div class="t1">
            <p>腰围:</p>
            <p>{{ this.user.Get_CheckSub_Data.Sub_Waistline }}</p>
          </div>
          <div class="t1">
            <p>左手收缩压值:</p>
            <p>{{ this.user.Get_CheckSub_Data.Sub_Constriction_L }}</p>
          </div>
          <div class="t1">
            <p>左手舒张压值:</p>
            <p>{{ this.user.Get_CheckSub_Data.Sub_Diastolic_L }}</p>
          </div>
          <div class="t1">
            <p>左眼视力:</p>
            <p>{{ this.user.Get_CheckSub_Data.Sub_LeftEye }}</p>
          </div>
          <div class="t1">
            <p>右眼视力:</p>
            <p>{{ this.user.Get_CheckSub_Data.Sub_RightEye }}</p>
          </div>
          <div class="t1">
            <p>左眼矫正视力:</p>
            <p>{{ this.user.Get_CheckSub_Data.Sub_RecLeftEye }}</p>
          </div>
          <div class="t1">
            <p>右眼矫正视力:</p>
            <p>{{ this.user.Get_CheckSub_Data.Sub_RecRightEye }}</p>
          </div>
        </div>
      </div>
      <div class="sidebar-content3" @click="sendsj">
        <h3 class="s-h3">提交数据</h3>
      </div>
    </div>
    <div class="scrollable-content" @scroll="handleScroll" :key="componentKey">
      <div class="tab">
        <div class="tabd">
          <div v-for="(item, index) in dd" :key="index" class="tab-list">
            <el-button class="ppp" @click="scrollTo(item[0].Sub_TypeID)">
              {{ item[0].Sub_TypeName }}</el-button
            >
          </div>
        </div>
        <div class="tabd">
          <div v-for="(item, index) in this.tab2" :key="index" class="tab-list">
            <el-button
              class="ppp"
              @click="scrollTo1(index)"
              v-show="show.Gw_InHos == '1' && index == 0"
              >{{ item }}</el-button
            >
            <el-button
              class="ppp"
              @click="scrollTo1(index)"
              v-show="show.Gw_BadHos == '1' && index == 1"
              >{{ item }}</el-button
            >
            <el-button
              class="ppp"
              @click="scrollTo1(index)"
              v-show="show.Gw_YhHos == '1' && index == 2"
              >{{ item }}</el-button
            >
            <el-button
              class="ppp"
              @click="scrollTo1(index)"
              v-show="show.Gw_Yyqk == '1' && index == 3"
              >{{ item }}</el-button
            >
          </div>
        </div>
      </div>
      <!-- 滚动的内容 -->
      <div class="st">
        <div class="rank_box">
          <div>
            <div
              v-for="(item, index1) in dd"
              :key="index1"
              class="rank_div"
              :id="`rank_div${item[0].Sub_TypeID}`"
            >
              <h2>{{ index1 + 1 }} {{ item[0].Sub_TypeName }}</h2>
              <div
                v-for="(u, indexs) in item" 
                :key="indexs"
                :id="`tt${u.Rever_Sub}`"
                class="tt"
                :class="`tt${u.Rever_Sub}`"
              >
                <div v-if="u.Val_Type == 1" class="ttd">
                  <div :id="`ttd${u.Rever_Sub}`"  :class="`ttd${u.Rever_Sub}`" class="ttd" >
                        <h3>{{ u.Sub_Name }}</h3>
                      <input
                        type="text"
                        class="input"
                        ref="input"
                        v-model="user.jkwd[index1][indexs].check"
                        @input="updateInputValue($event.target.value, u)"
                        @focus="handleFocus"
                      />
                      <h3>{{ u.Val_Unit }}</h3>
                  </div>
                </div>
                <div v-show="u.Val_Type == 0">
                  <div v-show="u.Val_SctMode == 2" class="ttd">
                    <div
                     v-if="(u.Sub_SysType == '' || u.Sub_SysType == '0')"
                      class="ttd"
                      :id="`ttd${u.Rever_Sub}`"
                    >
                      <h3>{{ u.Sub_Name }}</h3>
                      <input
                        type="text"
                        class="input"
                        ref="input"
                        v-model="user.jkwd[index1][indexs].check"
                        @input="updateInputValue($event.target.value, u)"
                        @focus="handleFocus"
                      />
                      <h3>{{ u.Val_Unit }}</h3>
                    </div>
                    <div v-if="u.Sub_SysType == '5'" class="qc">
                      <div
                        :id="`ttd${u.Rever_Sub}`"
                        class="q1"
                        v-show="
                          user.jkwd[index1][1].checkedlist.includes('缺齿')
                        "
                      >
                        <span class="s1">缺齿</span>
                        <el-row>
                          <el-col :span="12">
                            <input
                              placeholder="右上"
                              type="text"
                              ref="input"
                              class="cross-input"
                              v-model="user.jkwd[index1][3].check"
                              @input="
                                updateInputValue($event.target.value, item[3])
                              "
                            />
                          </el-col>
                          <el-col :span="12">
                            <input
                              placeholder="左上"
                              type="text"
                              @input="
                                updateInputValue($event.target.value, item[2])
                              "
                              ref="input"
                              class="cross-input"
                              v-model="user.jkwd[index1][2].check"
                            />
                          </el-col>
                          <el-col :span="12">
                            <input
                              placeholder="右下"
                              type="text"
                              ref="input"
                              class="cross-input"
                              v-model="user.jkwd[index1][5].check"
                              @input="
                                updateInputValue($event.target.value, item[5])
                              "
                            />
                          </el-col>
                          <el-col :span="12">
                            <input
                              placeholder="左下"
                              type="text"
                              ref="input"
                              class="cross-input"
                              v-model="user.jkwd[index1][4].check"
                              @input="
                                updateInputValue($event.target.value, item[4])
                              "
                            />
                          </el-col>
                        </el-row>
                      </div>
                      <div
                        class="q2"
                        v-show="
                          user.jkwd[index1][1].checkedlist.includes('龋齿')
                        "
                      >
                        <span class="s1">龋齿</span>
                        <el-row>
                          <el-col :span="12">
                            <input
                              placeholder="右上"
                              type="text"
                              ref="input"
                              class="cross-input"
                              v-model="user.jkwd[index1][7].check"
                              @input="
                                updateInputValue($event.target.value, item[7])
                              "
                            />
                          </el-col>
                          <el-col :span="12">
                            <input
                              placeholder="左上"
                              type="text"
                              @input="
                                updateInputValue($event.target.value, item[6])
                              "
                              ref="input"
                              class="cross-input"
                              v-model="user.jkwd[index1][6].check"
                            />
                          </el-col>
                          <el-col :span="12">
                            <input
                              placeholder="右下"
                              type="text"
                              ref="input"
                              class="cross-input"
                              v-model="user.jkwd[index1][9].check"
                              @input="
                                updateInputValue($event.target.value, item[9])
                              "
                            />
                          </el-col>
                          <el-col :span="12">
                            <input
                              placeholder="左下"
                              type="text"
                              ref="input"
                              class="cross-input"
                              v-model="user.jkwd[index1][8].check"
                              @input="
                                updateInputValue($event.target.value, item[8])
                              "
                            />
                          </el-col>
                        </el-row>
                      </div>
                      <div
                        class="q3"
                        v-show="
                          user.jkwd[index1][1].checkedlist.includes('义齿')
                        "
                      >
                        <span class="s1">义齿</span>
                        <el-row>
                          <el-col :span="12">
                            <input
                              placeholder="右上"
                              type="text"
                              ref="input"
                              class="cross-input"
                              v-model="user.jkwd[index1][11].check"
                              @input="
                                updateInputValue($event.target.value, item[11])
                              "
                            />
                          </el-col>
                          <el-col :span="12">
                            <input
                              placeholder="左上"
                              type="text"
                              @input="
                                updateInputValue($event.target.value, item[10])
                              "
                              ref="input"
                              class="cross-input"
                              v-model="user.jkwd[index1][10].check"
                            />
                          </el-col>
                          <el-col :span="12">
                            <input
                              placeholder="右下"
                              type="text"
                              ref="input"
                              class="cross-input"
                              v-model="user.jkwd[index1][13].check"
                              @input="
                                updateInputValue($event.target.value, item[13])
                              "
                            />
                          </el-col>

                          <el-col :span="12">
                            <input
                              placeholder="左下"
                              type="text"
                              ref="input"
                              class="cross-input"
                              v-model="user.jkwd[index1][12].check"
                              @input="
                                updateInputValue($event.target.value, item[12])
                              "
                            />
                          </el-col>
                        </el-row>
                      </div>
                    </div>
                  </div>
                  <div v-show="u.Val_SctMode == 1">
                    <div>
                      <div class="ddd" :id="`ttd${u.Rever_Sub}`">
                        <h3>{{ u.Sub_Name }}(多选)</h3>
                        <div
                          v-if="
                            (getUserPosts(u).length == 7 ||
                              getUserPosts(u).length == 8) &&
                            getUserPosts(u)[0].Opt_IsNormal !== '1'
                          "
                          :id="`ttd${u.Rever_Sub}`"
                          class="dddd"
                        >
                          <van-switch
                            v-model="user.jkwd[index1][indexs].check1"
                            @change="
                              checkAllChange(
                                user.jkwd[index1][indexs].check1,
                                getUserPosts(u),
                                u
                              )
                            "
                          />
                          <h3>全选</h3>
                        </div>
                      </div>
                      <van-checkbox-group
                        v-model="user.jkwd[index1][indexs].checkedlist"
                        class="tts"
                      >
                        <van-checkbox
                          v-for="option in getUserPosts(u)"
                          :key="option.Opt_Name"
                          :name="option.Opt_Name"
                          @click="onerinet(option, indexs, getUserPosts(u))"
                        >
                          <p class="pp">{{ option.Opt_Name }}</p>
                          <div
                            v-show="
                              option.Sub_OtOptID !== '' &&
                              option ==
                                getUserPosts(u)[getUserPosts(u).length - 1]
                            "
                            class="dds"
                            :style="{ transform: 'scale(' + scale + ')' }"
                          >
                            <input
                              type="text"
                              class="input"
                              @keyup.enter="handleGoKey"
                              ref="input"
                              @focus.stop="handleFocus"
                              @blur="handleBlur"
                              v-model="user.jkwd[index1][indexs].Sub_OtOptRlt"
                              @click.stop="
                                updateInputValue1(
                                  $event.target.value,
                                  u,
                                  option
                                )
                              "
                              @input="
                                updateInputValue1(
                                  $event.target.value,
                                  u,
                                  option
                                )
                              "
                            />
                            <el-button
                              v-if="u.Val_OtOpts !== ''"
                              @click.stop="select(u, getUserPosts(u))"
                              >选择</el-button
                            >
                          </div>
                        </van-checkbox>
                      </van-checkbox-group>
                    </div>
                  </div>
                  <div v-show="u.Val_SctMode == 0">
                    <div :id="`ttd${u.Rever_Sub}`">
                      <div class="ttd">
                        <h3>{{ u.Sub_Name }}(单选)</h3>
                        <el-button
                          class="bbbn"
                          type="primary"
                          @click="onuser1(getUserPosts(u))"
                          >重置</el-button
                        >
                      </div>
                      <van-radio-group
                        v-model="user.jkwd[index1][indexs].check"
                        class="tts"
                      >
                        <van-cell-group
                          v-for="i in getUserPosts(u)"
                          :key="i.Sub_ID"
                        >
                          <van-radio
                            :name="`${i.Opt_Name}`"
                            @click.prevent="
                              onuser(i.Opt_Name, i.Sub_ID, indexs, i)
                            "
                            border
                            ><p class="pp">{{ i.Opt_Name }}</p></van-radio
                          >
                          <div
                            v-show="
                              i.Sub_OtOptID !== '' &&
                              i == getUserPosts(u)[getUserPosts(u).length - 1]
                            "
                            class="dds"
                          >
                            <input
                              type="text"
                              class="input"
                              @keyup.enter="handleGoKey"
                              ref="input"
                              @focus="handleFocus"
                              @blur="handleBlur"
                              v-model="user.jkwd[index1][indexs].Sub_OtOptRlt"
                              @click.stop="
                                updateInputValue1($event.target.value, u, i)
                              "
                              @input="
                                updateInputValue1($event.target.value, u, i)
                              "
                            />
                            <el-button
                              v-show="u.Val_OtOpts !== ''"
                              @click.stop="select(u, getUserPosts(u))"
                              >选择</el-button
                            >
                          </div>
                        </van-cell-group>
                      </van-radio-group>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="taa" id="taa0" v-show="show.Gw_InHos == '1'">
            <div>
              住院史
            </div>
            <el-button @click="showDialog1 = true" type="primary"
              >住院史新增</el-button
            >
            <my-form-dialog
              v-model="showDialog1"
              @s1="h1"
              @submit1="handleSubmit1"
              :parentData1="message1"
            ></my-form-dialog>
            <el-table :data="user.tableData1" border style="width: 100%;">
              <el-table-column prop="date1" label="入院日期" />
              <el-table-column prop="date2" label="出院院日期" />
              <el-table-column prop="date3" label="原因" />
              <el-table-column prop="date4" label="医疗机构名称" />
              <el-table-column prop="date5" label="病案号" />
              <el-table-column label="操作">
                <template #default="scope">
                  <el-button
                    class="scopebutton"
                    size="small"
                    type="primary"
                    @click="handlexg1(scope.$index, scope.row)"
                    >修改</el-button
                  >
                  <el-button
                    class="scopebutton"
                    size="small"
                    type="danger"
                    @click="handlesc1(scope.$index, scope.row)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
              <!-- 你的表格内容 -->
            </el-table>
          </div>
          <div class="taa" id="taa1" v-show="show.Gw_BadHos == '1'">
            <div>
              家庭病床史
            </div>
            <el-button @click="showDialog2 = true" type="primary"
              >家庭病床史新增</el-button
            >
            <my-form-dialog
              v-model="showDialog2"
              @s2="h2"
              @submit2="handleSubmit2"
              :parentData2="message2"
            ></my-form-dialog>
            <el-table :data="user.tableData2" border style="width: 100%;">
              <el-table-column prop="date1" label="建床日期" />
              <el-table-column prop="date2" label="撤床日期" />
              <el-table-column prop="date3" label="原因" />
              <el-table-column prop="date4" label="医疗机构名称" />
              <el-table-column prop="date5" label="病案号" />
              <el-table-column label="操作">
                <template #default="scope">
                  <el-button
                    class="scopebutton"
                    size="small"
                    type="primary"
                    @click="handlexg2(scope.$index, scope.row)"
                    >修改</el-button
                  >
                  <el-button
                    class="scopebutton"
                    size="small"
                    type="danger"
                    @click="handlesc2(scope.$index, scope.row)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
              <!-- 你的表格内容 -->
            </el-table>
          </div>
          <div class="taa" id="taa2" v-show="show.Gw_YhHos == '1'">
            <div>
              非免疫规划预防接种史
            </div>
            <el-button @click="showDialog3 = true" type="primary"
              >非免疫规划预防接种史新增</el-button
            >
            <my-form-dialog
              v-model="showDialog3"
              @s3="h3"
              @submit3="handleSubmit3"
              :parentData3="message3"
            ></my-form-dialog>
            <el-table :data="user.tableData3" border style="width: 100%;">
              <el-table-column prop="name" label="名称" width="100px" />
              <el-table-column prop="date1" label="接种日期" width="180px" />
              <el-table-column prop="date2" label="接种机构" />
              <el-table-column label="操作">
                <template #default="scope">
                  <el-button
                    class="scopebutton"
                    size="small"
                    type="primary"
                    @click="handlexg3(scope.$index, scope.row)"
                    >修改</el-button
                  >
                  <el-button
                    class="scopebutton"
                    size="small"
                    type="danger"
                    @click="handlesc3(scope.$index, scope.row)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
              <!-- 你的表格内容 -->
            </el-table>
          </div>
          <div class="taa" id="taa3" v-show="show.Gw_Yyqk == '1'">
            <div>
              主要用药情况
            </div>
            <el-button @click="showDialog4 = true" type="primary"
              >主要用药情况新增</el-button
            >
            <my-form-dialog
              v-model="showDialog4"
              @s4="h4"
              @submit4="handleSubmit4"
              :parentData4="message4"
              :parentData5="message5"
            ></my-form-dialog>
            <el-table :data="user.tableData4" border style="width: 100%;">
              <el-table-column prop="date9" label="用药分类" />
              <el-table-column prop="name" label="用药名称" />
              <el-table-column prop="date1" label="用法" />
              <el-table-column label="用量" prop="date2"></el-table-column>
              <el-table-column prop="date4" label="用药时间" />
              <el-table-column prop="date8" label="服药依从性" />
              <el-table-column label="操作">
                <template #default="scope">
                  <el-button
                    class="scopebutton"
                    size="small"
                    type="primary"
                    @click="handlexg4(scope.$index, scope.row)"
                    >修改</el-button
                  >
                  <el-button
                    class="scopebutton"
                    size="small"
                    type="danger"
                    @click="handlesc4(scope.$index, scope.row)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { showDialog } from "vant";
import FormDialog2 from "./FormDialog2.vue";
import FormDialog4 from "./FormDialog4.vue";
import FormDialog5 from "./FormDialog5.vue";
import MyFormDialog from "./MyFormDialog.vue";
import { userStore } from "../../stores/user.ts";
import { ElMessageBox, ElMessage } from "element-plus";
export default {
  data() {
    return {
      componentKey: 0,
      val1: "",
      isCheckAll: false,
      isIndeterminate: true,
      longList: Array.from({ length: 100 }, (_, i) => `项目 ${i + 1}`), // 示例长列表
      tabs: ["生活方式", "住院治疗情况", "Tab 3", "Tab 4"],
      tab2: ["住院历史", "家庭病床史", "非免疫规划预防接种史", "主要用药情"],
      activeTab: 0,
      activeTab: "",
      wtlist: "",
      ue: "",
      lists: [],
      check: false,
      checkedlist: [],
      customInputValue: "",
      scale: 1,
      checkboxGroup: null,
      user: "",
      dds: "",
      dd: "",
      ed: "",
      showDialog1: false,
      showDialog2: false,
      showDialog3: false,
      showDialog4: false,
      showDialogs1: false,
      showDialogse1: false,
      showDialogse2: false,
      showDialogse3: false,
      showDialogse4: false,
      showDialogse5: false,
      showzzpg: false,
      tableData1: [],
      tableData2: [],
      tableData3: [],
      tableData4: [],
      tableDatas4: [],
      tableDatas1: {},
      message1: "0",
      message2: "1",
      message3: "2",
      message4: "3",
      message5: {},
      messages1: "0",
      messagese1: null,
      messagese2: null,
      messagese3: null,
      messagese4: null,
      messagese5: null,
      messageszzpg: null,
      sss: "",
      sss1: "",
      show: {},
      tdata1: [],
      tdata2: [],
      tdata3: [],
      tdata4: [],
      t1: [],
      t2: [],
      t3: [],
      t4: [],
      ts4: [],
      loading: null,
      checkRadioFlag: false,
      send: true,
    };
  },
  components: {
    MyFormDialog,
    FormDialog2,
    FormDialog4,
    FormDialog5,
  },
  methods: {
    handleSubmitse5(val1, val2) {
      this.showDialogse5 = val2;
      console.log("11111111", val1.join(","));
      this.user.jkwd.forEach((item) => {
        item.forEach((item1) => {
          if (
            this.user.select_u.Sub_Name == item1.Sub_Name &&
            this.user.select_u.Sub_ID == item1.Sub_ID
          ) {
            item1.Sub_OtOptRlt = val1.join(",");
            item1.Sub_OtOptID = this.user.u2.Sub_OtOptID;
          }
        });
      });
      this.user.select_u = {};
      this.user.select = "";
      this.user.u2 = {};
      sessionStorage.setItem("select", JSON.stringify(this.user.select));
      sessionStorage.setItem("u2", JSON.stringify(this.user.u2));
      sessionStorage.setItem("select_u", JSON.stringify(this.user.select_u));
      sessionStorage.setItem("wd", JSON.stringify(this.user.jkwd));
    },
    select(u, u2) {
      console.log(u, u2);
      this.showDialogse5 = true;
      this.user.select = u.Val_OtOpts;
      this.user.select_u = u;
      this.user.u2 = u2[u2.length - 1];
      sessionStorage.setItem("u2", JSON.stringify(this.user.u2));
      sessionStorage.setItem("select", JSON.stringify(this.user.select));
      sessionStorage.setItem("select_u", JSON.stringify(this.user.select_u));
    },
    scrollTo(tab) {
      console.log(tab);
      console.log(document.getElementById(`rank_div${tab}`));
      document.getElementById(`rank_div${tab}`).scrollIntoView({
        behavior: "smooth",
        block: "start",
      });
    },
    scrollTo1(tab) {
      console.log(tab);
      console.log(document.getElementById(`taa${tab}`));
      document.getElementById(`taa${tab}`).scrollIntoView({
        behavior: "smooth",
        block: "start",
      });
    },
    onRadioChange(val) {
      console.log(val);
      this.user.jkwd.forEach((item) => {
        item.forEach((item1) => {
          if (item1.check == val) {
            item1.check = "";
          }
        });
      });
    },
    forceRefresh() {
      this.componentKey += 1;
    },
    imaged() {
      this.user.xqlist1 = {};
      this.user.Get_CheckSub_Data = {};
      sessionStorage.removeItem("t1");
      sessionStorage.removeItem("t2");
      sessionStorage.removeItem("t3");
      sessionStorage.removeItem("t4");
      sessionStorage.removeItem("ts4");
      sessionStorage.removeItem("wd");
      sessionStorage.removeItem("data"), sessionStorage.removeItem("xq1");
      this.user.tableData1 = [];
      this.user.tableData2 = [];
      this.user.tableData3 = [];
      this.user.tableData4 = [];
      this.user.tableDatas4 = [];
      this.$router.push("/tab");
    },
    checkAllChange(val1, val2, val3) {
      console.log(val1, val2, val3);
      var listed = [];
      val2.forEach((item) => {
        listed.push(item.Opt_Name);
      });
      console.log(listed);
      console.log(this.user.jkwd);
      this.user.jkwd.forEach((item) => {
        item.forEach((item1) => {
          if (item1.Sub_Name == val3.Sub_Name && val1 == true) {
            item1.checkedlist = listed;
          } else if (item1.Sub_Name == val3.Sub_Name && val1 == false) {
            item1.checkedlist = [];
          }
        });
      });
      console.log(this.user.jkwd);
      sessionStorage.setItem("wd", JSON.stringify(this.user.jkwd));
    },
    handleSubmitse1(data1, data2, data3) {
      console.log("12345", data1);
      console.log("1111", data1);
      this.tableData1.splice(data3, 1, data1);
      this.tableData1 =
        this.user.tableData1 != null ? this.user.tableData1 : this.tableData1;
      this.user.tableData1 = this.tableData1;
      sessionStorage.setItem("t1", JSON.stringify(this.tableData1));
      this.showDialogse1 = false;
    },
    handleSubmitse2(data1, data2, data3) {
      console.log("12345", data1);
      console.log("1111", data1);
      this.tableData2 =
        this.user.tableData2 != null ? this.user.tableData2 : this.tableData2;
      this.tableData2.splice(data3, 1, data1);
      this.user.tableData2 = this.tableData2;
      sessionStorage.setItem("t2", JSON.stringify(this.tableData2));
      this.showDialogse2 = false;
    },
    handleSubmitse3(data1, data2, data3) {
      console.log("12345", data1);
      console.log("1111", data1);
      this.tableData3 =
        this.user.tableData3 != null ? this.user.tableData3 : this.tableData3;
      this.tableData3.splice(data3, 1, data1);
      this.user.tableData3 = this.tableData3;
      sessionStorage.setItem("t3", JSON.stringify(this.tableData3));
      this.showDialogse3 = false;
    },
    handleSubmitse4(data1, data2, data3) {
      console.log("12345", data1);
      var data1s = {
        name: data1.name,
        date1: data1.date1,
        date2:
          data1.date2 + data1.date3 + "次；1次" + data1.date4 + data1.date5,
        date3: data1.date3,
        date4: data1.date6 + data1.date7,
        dates4: data1.date4,
        date5: data1.date5,
        date6: data1.date6,
        date7: data1.date7,
        date8: data1.date8,
        date1_id: data1.date1_id,
        date2_id: data1.date2_id,
        date5_id: data1.date5_id,
        date7_id: data1.date7_id,
        date8_id: data1.date8_id,
        date9: data1.date9,
        date9_id: data1.date9_id,
      };
      console.log("1111", data1s);
      this.tableDatas4 =
        this.user.tableDatas4 != null
          ? this.user.tableDatas4
          : this.tableDatas4;
      this.tableData4 =
        this.user.tableData4 != null ? this.user.tableData4 : this.tableData4;
      this.tableDatas4.splice(data3, 1, data1s);
      this.tableData4.splice(data3, 1, data1s);
      this.user.tableDatas4 = this.tableDatas4;
      this.user.tableData4 = this.tableData4;
      sessionStorage.setItem("ts4", JSON.stringify(this.tableDatas4));
      sessionStorage.setItem("t4", JSON.stringify(this.tableData4));
      this.showDialogse4 = false;
    },
    handlexg1(index, row) {
      console.log(row);
      this.$confirm("您确认要修改吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        customClass: "messageBox",
      })
        .then(() => {
          // 用户点击确认
          this.messagese1 = this.user.tableData1[index];
          console.log(this.messagese1);
          if (this.messagese1) {
            this.$refs.FormDialog1.receiveData1(this.messagese1, index);
            this.showDialogse1 = true;
          }
          // 在这里执行跳转逻辑
        })
        .catch(() => {
          // 用户点击取消
          this.$message.info("已取消修改操作");
          // 如果需要可以在这里执行其他逻辑
        });
    },
    handlexg2(index, row) {
      console.log(row);
      this.$confirm("您确认要修改吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        customClass: "messageBox",
      })
        .then(() => {
          // 用户点击确认
          this.messagese2 = this.user.tableData2[index];
          console.log(this.messagese2);
          if (this.messagese2) {
            this.$refs.FormDialog2.receiveData2(this.messagese2, index);
            this.showDialogse2 = true;
          }
          // 在这里执行跳转逻辑
        })
        .catch(() => {
          // 用户点击取消
          this.$message.info("已取消修改操作");
          // 如果需要可以在这里执行其他逻辑
        });
    },
    handlexg3(index, row) {
      console.log(row);
      this.$confirm("您确认要修改吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        customClass: "messageBox",
      })
        .then(() => {
          // 用户点击确认
          this.messagese3 = this.user.tableData3[index];
          console.log(this.messagese3);
          if (this.messagese3) {
            this.$refs.FormDialog3.receiveData3(this.messagese3, index);
            this.showDialogse3 = true;
          }
          // 在这里执行跳转逻辑
        })
        .catch(() => {
          // 用户点击取消
          this.$message.info("已取消修改操作");
          // 如果需要可以在这里执行其他逻辑
        });
    },
    handlexg4(index, row) {
      console.log(row);
      this.$confirm("您确认要修改吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        customClass: "messageBox",
      })
        .then(() => {
          // 用户点击确认
          this.messagese4 = this.user.tableDatas4[index];
          console.log(this.messagese4);
          if (this.messagese4) {
            this.$refs.FormDialog4.receiveData4(this.messagese4, index);
            this.showDialogse4 = true;
          }
          // 在这里执行跳转逻辑
        })
        .catch(() => {
          // 用户点击取消
          this.$message.info("已取消修改操作");
          // 如果需要可以在这里执行其他逻辑
        });
    },
    handlesc1(index, row) {
      this.$confirm("您确认要删除吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        customClass: "messageBox",
      })
        .then(() => {
          // 用户点击确认
          this.tableData1 =
            this.user.tableData1 != null
              ? this.user.tableData1
              : this.tableData1;
          this.tableData1.splice(index, 1);
          sessionStorage.setItem("t1", JSON.stringify(this.tableData1));
          this.user.tableData1 = this.tableData1;
          console.log("删除行:", index, row);
          // 在这里执行跳转逻辑
        })
        .catch(() => {
          // 用户点击取消
          this.$message.info("已取消删除操作");
          // 如果需要可以在这里执行其他逻辑
        });
      // 删除操作，例如确认后从tableData中移除该行
    },
    handlesc2(index, row) {
      this.$confirm("您确认要删除吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        customClass: "messageBox",
      })
        .then(() => {
          // 用户点击确认
          this.tableData2 =
            this.user.tableData2 != null
              ? this.user.tableData2
              : this.tableData2;
          this.tableData2.splice(index, 1);
          sessionStorage.setItem("t2", this.tableData4);
          this.user.tableData2 = this.tableData2;
          console.log("删除行:", index, row);
          // 在这里执行跳转逻辑
        })
        .catch(() => {
          // 用户点击取消
          this.$message.info("已取消删除操作");
          // 如果需要可以在这里执行其他逻辑
        });
      // 删除操作，例如确认后从tableData中移除该行
    },
    handlesc3(index, row) {
      this.$confirm("您确认要删除吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        customClass: "messageBox",
      })
        .then(() => {
          // 用户点击确认
          this.tableData3 =
            this.user.tableData3 != null
              ? this.user.tableData3
              : this.tableData3;
          this.tableData3.splice(index, 1);
          sessionStorage.setItem("t3", this.tableData3);
          this.user.tableData3 = this.tableData3;
          console.log("删除行:", index, row);
          // 在这里执行跳转逻辑
        })
        .catch(() => {
          // 用户点击取消
          this.$message.info("已取消删除操作");
          // 如果需要可以在这里执行其他逻辑
        });
      // 删除操作，例如确认后从tableData中移除该行
    },
    handlesc4(index, row) {
      this.$confirm("您确认要删除吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        customClass: "messageBox",
      })
        .then(() => {
          // 用户点击确认
          this.tableDatas4 =
            this.user.tableDatas4 != null
              ? this.user.tableDatas4
              : this.tableDatas4;
          this.tableData4 =
            this.user.tableData4 != null
              ? this.user.tableData4
              : this.tableData4;
          this.tableDatas4.splice(index, 1);
          this.tableData4.splice(index, 1);
          sessionStorage.setItem("ts4", JSON.stringify(this.tableDatas4));
          sessionStorage.setItem("t4", JSON.stringify(this.tableData4));
          this.user.tableDatas4 = this.tableDatas4;
          this.user.tableData4 = this.tableData4;
          console.log("删除行:", index, row);
          // 在这里执行跳转逻辑
        })
        .catch(() => {
          // 用户点击取消
          this.$message.info("已取消删除操作");
          // 如果需要可以在这里执行其他逻辑
        });
      // 删除操作，例如确认后从tableData中移除该行
    },
    guolu() {
      this.tdata4 = this.user.tableData4.map((item) => ({
        Medi_Name: item["name"],
        Medi_Use: item["date1_id"],
        Medi_freq: item["date2_id"],
        Medi_EachDose: item["date3"],
        Medi_EachDoseUnit: item["dates4"],
        Medi_DoseUnit: item["date5_id"],
        Medi_UseDate: item["date6"],
        Medi_UseDateUnit: item["date7_id"],
        Medi_MedicineYield: item["date8_id"],
        Medi_TypeID: item["date9_id"],
      }));
      this.tdata1 = this.user.tableData1.map((item) => ({
        Hos_InDate: item["date1"],
        Hos_OutDate: item["date2"],
        Hos_Cause: item["date3"],
        Hos_Group: item["date4"],
        Hos_No: item["date5"],
      }));
      this.tdata2 = this.user.tableData2.map((item) => ({
        Hos_InDate: item["date1"],
        Hos_OutDate: item["date2"],
        Hos_Cause: item["date3"],
        Hos_Group: item["date4"],
        Hos_No: item["date5"],
      }));
      this.tdata3 = this.user.tableData3.map((item) => ({
        Ino_Name: item["name"],
        Ino_Date: item["date1"],
        Ino_Group: item["date2"],
      }));
    },
    lodding() {
      this.loading = this.$loading({
        lock: true,
        text: "健康问答数据提交中...",
        background: "rgba(0, 0, 0, 0.7)",
      });
    },

    verification() {
      this.send = true;
      this.user.jkwd.forEach((item) => {
        item.forEach((item1) => {
           if (
            item1.Val_Type == "0" &&
            item1.Val_SctMode == "0" &&
            item1.Sub_ID!=("520005"||'520034'||"520008"||'520001'||'520011')&&
            item1.Sub_OtOptRlt == "" &&
            (item1.check == "是" ||
              item1.check == "其他" ||
              item1.check == "异常")
          ) {
            this.send = false;
            ElMessage.error({
              message: `检测到您题名为${item1.Sub_Name}的问答中有选项未填值尚未作答,请认真检查`,
            });
          } 



          if (
            item1.Val_Type == "0" &&
            item1.Val_SctMode == "1" &&
            item1.Sub_OtOptRlt == "" &&
            item1.checkedlist.includes("其他") == true
          ) {
            this.send = false;
            ElMessage.error({
              message: `检测到您题名为${item1.Sub_Name}的问答中有选项未填值尚未作答,请认真检查`,
            });
          } 
          else if (item1.Sub_ID == "520011" && item1.check != "不锻炼") {
            item
              .filter((list) => list.Rever_Sub == "520011")
              .forEach((item2) => {
                if (item2.check == "") {
                  this.send = false;
                  console.log("提交效益");
                  ElMessage.error({
                    message: `检测到您题名为${item2.Sub_Name}的问答尚未作答,请认真检查`,
                  });
                }
              });
          } else if (item1.Sub_ID == "520001" && item1.check != "从不吸烟") {
            item
              .filter((list) => list.Rever_Sub == "520001")
              .forEach((item2) => {
                if (item2.check == "") {
                  this.send = false;
                  console.log("提交效益");
                  ElMessage.error({
                    message: `检测到您题名为${item2.Sub_Name}的问答尚未作答,请认真检查`,
                  });
                }
              });
          } else if (item1.Sub_ID == "520007" && item1.check != "未戒酒") {
            item
              .filter((list) => list.Rever_Sub == "520007")
              .forEach((item2) => {
                if (item2.check == "") {
                  this.send = false;
                  console.log("提交效益");
                  ElMessage.error({
                    message: `检测到您题名为${item2.Sub_Name}的问答尚未作答,请认真检查`,
                  });
                }
              });
          } 
           else if (item1.Sub_ID == "520005" && item1.check != "从不") {
            item
              .filter((list) => list.Rever_Sub == "520005")
              .forEach((item2) => {
                if (
                  item2.check == "" &&
                  item2.Val_Type == "0" &&
                  item2.Val_SctMode == "2"
                ) {
                  this.send = false;
                  console.log("提交效益");
                  ElMessage.error({
                    message: `检测到您题名为${item2.Sub_Name}的问答尚未作答,请认真检查`,
                  });
                } else if (item2.check == "" && item2.Val_Type == "1") {
                  this.send = false;
                  console.log("提交效益");
                  ElMessage.error({
                    message: `检测到您题名为${item2.Sub_Name}的问答尚未作答,请认真检查`,
                  });
                } else if (
                  item2.checkedlist == "" &&
                  item2.Val_Type == "0" &&
                  item2.Val_SctMode == "1"
                ) {
                  this.send = false;
                  console.log("提交效益");
                  ElMessage.error({
                    message: `检测到您题名为${item2.Sub_Name}的问答尚未作答,请认真检查`,
                  });
                } else if (
                  item2.check == "" &&
                  item2.Val_Type == "0" &&
                  item2.Val_SctMode == "0"
                ) {
                  this.send = false;
                  console.log("提交效益");
                  ElMessage.error({
                    message: `检测到您题名为${item2.Sub_Name}的问答尚未作答,请认真检查`,
                  });
                } else if (
                  item2.checkedlist !== "" &&
                  item2.Val_Type == "0" &&
                  item2.Val_SctMode == "1" &&
                  item2.checkedlist.includes("其他") == true &&
                  item2.Sub_OtOptRlt == ""
                ) {
                  this.send = false;
                  ElMessage.error({
                    message: `检测到您题名为${item2.Sub_Name}的问答中其他选项未填值尚未作答,请认真检查`,
                  });
                }
              });
          } else if (item1.Sub_ID == "520034" && item1.check != "无") {
            item
              .filter((list) => list.Rever_Sub == "520034")
              .forEach((item2) => {
                if (
                  item2.check == "" &&
                  item2.Val_Type == "0" &&
                  item2.Val_SctMode == "2"
                ) {
                  this.send = false;
                  console.log("提交效益");
                  ElMessage.error({
                    message: `检测到您题名为${item2.Sub_Name}的问答尚未作答,请认真检查`,
                  });
                } else if (item2.check == "" && item2.Val_Type == "1") {
                  this.send = false;
                  console.log("提交效益");
                  ElMessage.error({
                    message: `检测到您题名为${item2.Sub_Name}的问答尚未作答,请认真检查`,
                  });
                } else if (
                  item2.checkedlist == "" &&
                  item2.Val_Type == "0" &&
                  item2.Val_SctMode == "1"
                ) {
                  this.send = false;
                  console.log("提交效益");
                  ElMessage.error({
                    message: `检测到您题名为${item2.Sub_Name}的问答尚未作答,请认真检查`,
                  });
                } else if (
                  item2.check == "" &&
                  item2.Val_Type == "0" &&
                  item2.Val_SctMode == "0"
                ) {
                  this.send = false;
                  console.log("提交效益");
                  ElMessage.error({
                    message: `检测到您题名为${item2.Sub_Name}的问答尚未作答,请认真检查`,
                  });
                } else if (
                  item2.checkedlist !== "" &&
                  item2.Val_Type == "0" &&
                  item2.Val_SctMode == "0" &&
                  item2.check == "有" &&
                  item2.Sub_OtOptRlt == ""
                ) {
                  this.send = false;
                  ElMessage.error({
                    message: `检测到您题名为${item2.Sub_Name}的问答中有选项未填值尚未作答,请认真检查`,
                  });
                }
              });
          } else if (item1.Sub_ID == "520108" && item1.checkedlist != "正常") {
            if (item1.checkedlist.includes("缺齿") == true) {
              item
                .filter((list) => list.Rever_Sub == "520108")
                .slice(0, 4)
                .forEach((item2) => {
                  if (item2.check == "") {
                    this.send = false;
                    ElMessage.error({
                      message: `检测到您题名为${item1.Sub_Name}中缺齿的${item2.Sub_Name}填值尚未作答完成,请认真检查`,
                    });
                  }
                });
            }
            if (item1.checkedlist.includes("龋齿") == true) {
              item
                .filter((list) => list.Rever_Sub == "520108")
                .slice(4, 8)
                .forEach((item2) => {
                  if (item2.check == "") {
                    this.send = false;
                    ElMessage.error({
                      message: `检测到您题名为${item1.Sub_Name}中龋齿的${item2.Sub_Name}填值尚未作答完成,请认真检查`,
                    });
                  }
                });
            }
            if (item1.checkedlist.includes("义齿") == true) {
              item
                .filter((list) => list.Rever_Sub == "520108")
                .slice(8, 12)
                .forEach((item2) => {
                  if (item2.check == "") {
                    this.send = false;
                    ElMessage.error({
                      message: `检测到您题名为${item1.Sub_Name}中义齿的${item2.Sub_Name}填值尚未作答完成,请认真检查`,
                    });
                  }
                });
            }
          }
        });
      });
    },
    async sendsj() {
      // console.log("this.verification()", this.verification());
      this.verification()
      if (this.send == true) {
        this.rmovesss();
        this.removesss1();
        console.log("sbdx", this.sss);
        await this.guolu();
        await this.lodding();
        if (this.show.Gw_InHos == "1") {
          axios
            .post(
              window.globalUrl.server + "Service.asmx/GwInHosInfo_Submit",
              JSON.stringify({
                User_Code: this.User_Code,
                Interface_Code: this.Interface_Code,
                Check_No: this.user.xqlist1.Check_No,
                Pson_CardID: this.user.xqlist1.Pson_CardID,
                Que_list: JSON.stringify(this.tdata1),
              })
            )
            .then((res) => {
              console.log("dataa");
              console.log(JSON.parse(res.data.RltData));
            })
            .catch((eorro) => {
              console.log(eorro);
            });
        }
        if (this.show.Gw_BadHos == "1") {
          axios
            .post(
              window.globalUrl.server + "Service.asmx/GwHomeHosInfo_Submit",
              JSON.stringify({
                User_Code: this.User_Code,
                Interface_Code: this.Interface_Code,
                Check_No: this.user.xqlist1.Check_No,
                Pson_CardID: this.user.xqlist1.Pson_CardID,
                Que_list: JSON.stringify(this.tdata2),
              })
            )
            .then((res) => {
              console.log("dataa");
              console.log(JSON.parse(res.data.RltData));
            })
            .catch((eorro) => {
              console.log(eorro);
            });
        }
        if (this.show.Gw_YhHos == "1") {
          axios
            .post(
              window.globalUrl.server + "Service.asmx/GwIncolInfo_Submit",
              JSON.stringify({
                User_Code: this.User_Code,
                Interface_Code: this.Interface_Code,
                Check_No: this.user.xqlist1.Check_No,
                Pson_CardID: this.user.xqlist1.Pson_CardID,
                Que_list: JSON.stringify(this.tdata3),
              })
            )
            .then((res) => {
              console.log("dataa");
              console.log(JSON.parse(res.data.RltData));
            })
            .catch((eorro) => {
              console.log(eorro);
            });
        }

        if (this.show.Gw_Yyqk == "1") {
          axios
            .post(
              window.globalUrl.server + "Service.asmx/GwMediInfo_Submit",
              JSON.stringify({
                User_Code: this.User_Code,
                Interface_Code: this.Interface_Code,
                Check_No: this.user.xqlist1.Check_No,
                Pson_CardID: this.user.xqlist1.Pson_CardID,
                Que_list: JSON.stringify(this.tdata4),
              })
            )
            .then((res) => {
              console.log("dataa");
              console.log(JSON.parse(res.data.RltData));
            })
            .catch((eorro) => {
              console.log(eorro);
            });
        }
        await axios
          .post(
            window.globalUrl.server + "Service.asmx/HealtQues_Submit",
            JSON.stringify({
              User_Code: this.User_Code,
              Interface_Code: this.Interface_Code,
              Check_No: this.user.xqlist1.Check_No,
              Pson_CardID: this.user.xqlist1.Pson_CardID,
              Que_list: JSON.stringify(this.sss),
            })
          )
          .then((res) => {
            if (res.data.RltCode == 1) {
              this.loading.close();
              showDialog({
                message: "健康问答提交成功。",
                theme: "round-button",
              }).then(() => {});
              console.log("111");
            }
          })
          .catch((eorro) => {
            console.log(eorro);
          });
        this.user.xqlist1 = {};
        this.user.Get_CheckSub_Data = {};
        await this.$nextTick(() => {
          this.dd = [];
          this.send = true;
          this.user.tableData1 = [];
          this.user.tableData2 = [];
          this.user.tableData3 = [];
          this.user.tableData4 = [];
          this.user.tableDatas4 = [];
          sessionStorage.removeItem("xq1");
          sessionStorage.removeItem("t1");
          sessionStorage.removeItem("t2");
          sessionStorage.removeItem("t3");
          sessionStorage.removeItem("t4");
          sessionStorage.removeItem("ts4");
          sessionStorage.removeItem("wd");
          sessionStorage.removeItem("data");
        });
      }
    },
    rmovesss() {
      console.log(this.sss1);
      this.sss1 = this.user.jkwd;
      this.sss1.forEach((item) => {
        item.forEach((item1) => {
          item1.checkedlist = Array.from(item1.checkedlist).join(",");
          console.log("sb", item1.checkedlist);
        });
      });

      console.log("22222", this.sss1);
    },
    removesss1() {
      this.sss = this.sss1.map((array) =>
        array.map((item1) => ({
          Sub_Type: item1["Sub_TypeID"],
          Sub_ID: item1["Sub_ID"],
          Sub_OptRlt:
            item1["check"] == "" ? item1["checkedlist"] : item1["check"],
          Sub_OtOptID: item1["Sub_OtOptID"],
          Sub_OtOptRlt: item1["Sub_OtOptRlt"],
        }))
      );
      console.log("9999999");
      console.log("333333333333333", this.sss);
    },
    getshow() {
      axios
        .post(
          window.globalUrl.server + "Service.asmx/GetUserGwBaseQues2",
          JSON.stringify({
            User_Code: this.User_Code,
            Interface_Code: this.Interface_Code,
          })
        )
        .then((res) => {
          this.show = JSON.parse(res.data.RltData);
          console.log("dataa");
          console.log(JSON.parse(res.data.RltData));
        });
    },
    handleSubmits1(data1, data2) {
      this.showDialogs1 = data1;
      this.ue = [];
      sessionStorage.removeItem("t1");
      sessionStorage.removeItem("t2");
      sessionStorage.removeItem("t3");
      sessionStorage.removeItem("t4");
      sessionStorage.removeItem("ts4");
      this.user.tableData1 = [];
      this.user.tableData2 = [];
      this.user.tableData3 = [];
      this.user.tableData4 = [];
      this.user.tableDatas4 = [];
      sessionStorage.removeItem("wd");
      axios
        .post(
          window.globalUrl.server + "Service.asmx/GetQueInHoss",
          JSON.stringify({
            User_Code: this.User_Code,
            Interface_Code: this.Interface_Code,
            Pson_CardID: this.user.xqlist1.Pson_CardID,
          })
        )
        .then((res) => {
          if (res.data.RltCode == 1) {
            console.log("立棍", JSON.parse(res.data.RltData));
            this.t1 = JSON.parse(res.data.RltData);
            this.t1 = this.t1.map((item) => ({
              date1: item["Hos_InDate"],
              date2: item["Hos_OutDate"],
              date3: item["Hos_Cause"],
              date4: item["Hos_Group"],
              date5: item["Hos_No"],
            }));
            this.user.tableData1 = this.t1;
            sessionStorage.setItem("t1", JSON.stringify(this.t1));
          }
        });

      axios
        .post(
          window.globalUrl.server + "Service.asmx/GetQueHomeHoss",
          JSON.stringify({
            User_Code: this.User_Code,
            Interface_Code: this.Interface_Code,
            Pson_CardID: this.user.xqlist1.Pson_CardID,
          })
        )
        .then((res) => {
          if (res.data.RltCode == 1) {
            console.log("立棍", JSON.parse(res.data.RltData));
            this.t2 = JSON.parse(res.data.RltData);
            this.t2 = this.t2.map((item) => ({
              date1: item["Hos_InDate"],
              date2: item["Hos_OutDate"],
              date3: item["Hos_Cause"],
              date4: item["Hos_Group"],
              date5: item["Hos_No"],
            }));
            this.user.tableData2 = this.t2;
            sessionStorage.setItem("t2", JSON.stringify(this.t2));
          }
        });

      axios
        .post(
          window.globalUrl.server + "Service.asmx/GetQueInoculs",
          JSON.stringify({
            User_Code: this.User_Code,
            Interface_Code: this.Interface_Code,
            Pson_CardID: this.user.xqlist1.Pson_CardID,
          })
        )
        .then((res) => {
          if (res.data.RltCode == 1) {
            console.log("立棍", JSON.parse(res.data.RltData));
            this.t3 = JSON.parse(res.data.RltData);
            this.t3 = this.t3.map((item) => ({
              name: item["Ino_Name"],
              date1: item["Ino_Date"],
              date2: item["Ino_Group"],
            }));
            this.user.tableData3 = this.t3;
            sessionStorage.setItem("t3", JSON.stringify(this.t3));
          }
        });

      axios
        .post(
          window.globalUrl.server + "Service.asmx/GetQueUseMedis",
          JSON.stringify({
            User_Code: this.User_Code,
            Interface_Code: this.Interface_Code,
            Check_No: this.user.xqlist1.Check_No,
          })
        )
        .then((res) => {
          if (res.data.RltCode == 1) {
            console.log("立棍", JSON.parse(res.data.RltData));
            this.ts4 = JSON.parse(res.data.RltData);
            this.user.tableDatas4 = this.ts4.map((item) => ({
              name: item["Medi_Name"],
              date1: item["Medi_UseName"],
              date1_id: item["Medi_Use"],
              date2: item["Medi_freqName"],
              date2_id: item["Medi_freq"],
              date3: item["Medi_EachDose"],
              date4: item["Medi_EachDoseUnit"],
              date5: item["Medi_DoseUnitName"],
              date5_id: item["Medi_DoseUnit"],
              date6: item["Medi_UseDate"],
              date7: item["Medi_UseDateUnitName"],
              date7_id: item["Medi_UseDateUnit"],
              date8: item["Medi_MedicineYieldName"],
              date8_id: item["Medi_MedicineYield"],
              date9: item["Medi_Sugg"],
              date9_id: item["Medi_TypeID"],
            }));
            sessionStorage.setItem(
              "ts4",
              JSON.stringify(this.user.tableDatas4)
            );
            this.user.tableData4 = this.user.tableDatas4.map((item) => ({
              name: item["name"],
              date1: item["date1"],
              date1_id: item["date1_id"],
              date2:
                item["date2"] +
                item["date3"] +
                "次；1次" +
                item["date4"] +
                item["date5"],
              date2_id: item["date2_id"],
              date3: item["date3"],
              date4: item["date6"] + item["date7"],
              dates4: item["date4"],
              date5: item["date5"],
              date5_id: item["date5_id"],
              date6: item["date6"],
              date7: item["date7"],
              date7_id: item["date7"],
              date8: item["date8"],
              date8_id: item["date8_id"],
              date9: item["date9"],
              date9_id: item["date9_id"],
            }));
            sessionStorage.setItem("t4", JSON.stringify(this.user.tableData4));
          }
        });

      this.getwt();
    },
    handleSubmit1(data1, data2) {
      // 将数据添加到 tableData1
      this.tableData1 =
        this.user.tableData1 != null ? this.user.tableData1 : this.tableData1;
      this.tableData1.push({
        date1: data1.date1,
        date2: data1.date2,
        date3: data1.date3,
        date4: data1.date4,
        date5: data1.date5,
      });
      this.user.tableData1 = this.tableData1;
      sessionStorage.setItem("t1", JSON.stringify(this.tableData1));
      this.showDialog1 = data2;
      console.log(this.tableData1);
    },
    handleSubmit2(data1, data2) {
      // 将数据添加到 tableData2
      this.tableData2 =
        this.user.tableData2 != null ? this.user.tableData2 : this.tableData2;
      this.tableData2.push({
        date1: data1.date1,
        date2: data1.date2,
        date3: data1.date3,
        date4: data1.date4,
        date5: data1.date5,
      });
      this.user.tableData2 = this.tableData2;
      sessionStorage.setItem("t2", JSON.stringify(this.tableData2));
      this.showDialog2 = data2;
      console.log(this.tableData2);
    },
    handleSubmit3(data1, data2) {
      // 将数据添加到 tableData3
      this.tableData3 =
        this.user.tableData3 != null ? this.user.tableData3 : this.tableData3;
      this.tableData3.push({
        name: data1.name,
        date1: data1.date1,
        date2: data1.date2,
      });
      this.user.tableData3 = this.tableData3;
      sessionStorage.setItem("t3", JSON.stringify(this.tableData3));
      this.showDialog3 = data2;
      console.log(this.tableData3);
    },
    handleSubmit4(data1, data2) {
      this.tableDatas4 =
        this.user.tableDatas4 != null
          ? this.user.tableDatas4
          : this.tableDatas4;
      this.tableDatas4.push(data1);
      this.user.tableDatas4 = this.tableDatas4;
      sessionStorage.setItem("ts4", JSON.stringify(this.tableDatas4));
      // 将数据添加到 tableData4
      this.tableData4 =
        this.user.tableData4 != null ? this.user.tableData4 : this.tableData4;
      this.tableData4.push({
        name: data1.name,
        date1: data1.date1,
        date2:
          data1.date2 + data1.date3 + "次；1次" + data1.date4 + data1.date5,
        date3: data1.date3,
        date4: data1.date6 + data1.date7,
        dates4: data1.date4,
        date5: data1.date5,
        date6: data1.date6,
        date7: data1.date7,
        date8: data1.date8,
        date9: data1.date9,
        date9_id: data1.date9_id,
        date1_id: data1.date1_id,
        date2_id: data1.date2_id,
        date5_id: data1.date5_id,
        date7_id: data1.date7_id,
        date8_id: data1.date8_id,
      });
      this.user.tableData4 = this.tableData4;
      sessionStorage.setItem("t4", JSON.stringify(this.tableData4));
      this.showDialog4 = data2;
      console.log(this.tableData4, "xiehao");
    },
    h1(data1) {
      this.showDialog1 = data1;
    },
    h2(data1) {
      this.showDialog2 = data1;
    },
    h3(data1) {
      this.showDialog3 = data1;
    },
    h4(data1) {
      this.showDialog4 = data1;
    },
    updateInputValue(value1, value2) {
      console.log(value1);
      console.log(value2);
      this.user.jkwd.forEach((item) => {
        item.forEach((item1) => {
          if (
            item1.Sub_Name == value2.Sub_Name &&
            item1.Sub_ID == value2.Sub_ID
          ) {
            item1.check = value1;
          }
        });
      });
      console.log(this.user.jkwd);
      sessionStorage.setItem("wd", JSON.stringify(this.user.jkwd));
    },
    updateInputValue1(value1, value2, value3) {
      console.log(value1);
      console.log(value2);
      console.log("6666", value3);
      this.user.jkwd.forEach((item) => {
        item.forEach((item1) => {
          if (
            item1.Sub_Name == value2.Sub_Name &&
            item1.Sub_ID == value2.Sub_ID
          ) {
            item1.Sub_OtOptID = value3.Sub_OtOptID;
            console.log(value1);
            item1.Sub_OtOptRlt = value1;
          }
        });
      });
      console.log(this.user.jkwd);
      sessionStorage.setItem("wd", JSON.stringify(this.user.jkwd));
    },
    onerinet(option1, option2, option3) {
      console.log("option3", option3);
      console.log(option3[0].Opt_Name);
      console.log(option1);
      console.log(option2);
      console.log(this.user.jkwd);
      console.log("xdd", this.user.jkwd[option2]);
      this.user.jkwd.forEach((item1) => {
        // console.log(item1)
        item1.forEach((item) => {
          if (item.Sub_ID == option1.Sub_ID) {
            if (option3[0].Opt_IsNormal == "1") {
              if (
                option1.Opt_IsNormal == "" &&
                item.checkedlist.includes(option1.Opt_Name) == false
              ) {
                item.checkedlist = item.checkedlist;
              } else if (option1.Opt_IsNormal == "1") {
                item.checkedlist = [option1.Opt_Name];
              } else if (
                option1.Opt_IsNormal == "" &&
                item.checkedlist.includes(option3[0].Opt_Name) == true
              ) {
                var xb = item.checkedlist.findIndex(
                  (item) => item == option3[0].Opt_Name
                );
                item.checkedlist.splice(xb, 1);
              }
            } else if (option3[0].Opt_IsNormal == "") {
              item.checkedlist = item.checkedlist;
            }
          }
        });
      });
      this.user.jkwd.forEach((item1) => {
        item1.forEach((item) => {
          if (item.Sub_ID == "520108" && item.checkedlist == "正常") {
            item1
              .filter((list) => list.Rever_Sub == item.Sub_ID)
              .forEach((item2) => {
                item2.check = "";
              });
          } else if (
            item.Sub_ID == "520108" &&
            item.checkedlist.includes("缺齿") == false
          ) {
            item1
              .filter((list) => list.Rever_Sub == item.Sub_ID)
              .slice(0, 4)
              .forEach((item2) => {
                item2.check = "";
              });
          } else if (
            item.Sub_ID == "520108" &&
            item.checkedlist.includes("龋齿") == false
          ) {
            console.log(
              "9999",
              item1.filter((list) => list.Rever_Sub == item.Sub_ID).slice(4, 8)
            );
            item1
              .filter((list) => list.Rever_Sub == item.Sub_ID)
              .slice(4, 8)
              .forEach((item2) => {
                item2.check = "";
              });
          } else if (
            item.Sub_ID == "520108" &&
            item.checkedlist.includes("义齿") == false
          ) {
            console.log(item1.filter((list) => list.Rever_Sub == item.Sub_ID));
            item1
              .filter((list) => list.Rever_Sub == item.Sub_ID)
              .slice(8, 12)
              .forEach((item2) => {
                item2.check = "";
              });
          }
        });
      });
      sessionStorage.setItem("wd", JSON.stringify(this.user.jkwd));
    },
    onuser(option1, option2, option3, option4) {
      this.user.jkwd.forEach((item) => {
        item.forEach((item1) => {
          if (
            item1.check != "" &&
            item1.Sub_Rank == option4.Sub_Rank &&
            item1.Sub_Name == option4.Sub_Name &&
            item1.Val_Type == "0" &&
            item1.Val_SctMode == "0" &&
            item1.Sub_ID == option4.Sub_ID
          ) {
            item1.check = option4.Opt_Name;
          } 
           else if (item1.Sub_ID == option4.Sub_ID) {
            if (item1.check =="不锻炼"|| item1.check == "" ) {
              document.body
                .querySelectorAll(`#tt${item1.Sub_ID}`)
                .forEach((item) => {
                  item.style.display = "none";
                });
              item
                .filter((list) => list.Rever_Sub == option4.Sub_ID)
                .forEach((item2) => {
                  item2.check = "";
                  item2.checkedlist = "";
                  item2.Sub_OtOptRlt = "";
                });
              console.log(
                item.filter((list) => list.Rever_Sub == option4.Sub_ID)
              );
            } else if (item1.check != "不锻炼") {
              document.body
                .querySelectorAll(`#tt${item1.Sub_ID}`)
                .forEach((item) => {
                  item.style.display = "";
                });
            }
          } 
            if (item1.Sub_ID == option4.Sub_ID&&(item1.check == "从不吸烟"|| item1.check == "")) {
            if ((item1.check == "从不吸烟"|| item1.check == "")) {
              document.body
                .querySelectorAll(`#tt${item1.Sub_ID}`)
                .forEach((item) => {
                  item.style.display = "none";
                });
              item
                .filter((list) => list.Rever_Sub == option4.Sub_ID)
                .forEach((item2) => {
                  item2.check = "";
                  item2.checkedlist = "";
                  item2.Sub_OtOptRlt = "";
                });
              console.log(
                item.filter((list) => list.Rever_Sub == option4.Sub_ID)
              );
            } else if (item1.check != "从不吸烟") {
              document.body
                .querySelectorAll(`#tt${item1.Sub_ID}`)
                .forEach((item) => {
                  item.style.display = "";
                });
            }
          } 
         
               if (item1.Sub_ID == option4.Sub_ID&&(item1.check == "从不"|| item1.check == "")) {
            if ((item1.check == "从不"|| item1.check == "")) {
              document.body
                .querySelectorAll(`#tt${item1.Sub_ID}`)
                .forEach((item) => {
                  item.style.display = "none";
                });
                document
                .querySelectorAll(`#tt520007`)
                .forEach((item) => {
                  item.style.display = "none";
                });
              item
                .filter((list) => list.Rever_Sub == option4.Sub_ID)
                .forEach((item2) => {
                    item2.check = "";
                  item2.checkedlist = "";
                  item2.Sub_OtOptRlt = "";

                });
              console.log(
                item.filter((list) => list.Rever_Sub == option4.Sub_ID)
              );
            } else if (item1.check != "从不") {
              document.body
                .querySelectorAll(`#tt${item1.Sub_ID}`)
                .forEach((item) => {
                  item.style.display = "";
                });
            }
          } 



         if (item1.Sub_ID == option4.Sub_ID&&(item1.check == "无"|| item1.check == "")) {
            if ((item1.check == "无"|| item1.check == "")) {
              document.body
                .querySelectorAll(`#tt${item1.Sub_ID}`)
                .forEach((item) => {
                  item.style.display = "none";
                });
              item
                .filter((list) => list.Rever_Sub == option4.Sub_ID)
                .forEach((item2) => {
                  item2.check = "";
                  item2.checkedlist = "";
                  item2.Sub_OtOptRlt = "";
                });
              console.log(
                item.filter((list) => list.Rever_Sub == option4.Sub_ID)
              );
            } else if (item1.check != "无") {
              document.body
                .querySelectorAll(`#tt${item1.Sub_ID}`)
                .forEach((item) => {
                  item.style.display = "";
                });
            }
          } 


           if (item1.Sub_ID == option4.Sub_ID&&(item1.check == "未戒酒"|| item1.check == "")) {
            if ((item1.check == "未戒酒"|| item1.check == "")) {
              document.body
                .querySelectorAll(`#tt${item1.Sub_ID}`)
                .forEach((item) => {
                  item.style.display = "none";
                });
              item
                .filter((list) => list.Rever_Sub == option4.Sub_ID)
                .forEach((item2) => {
                  item2.check = "";
                  item2.checkedlist = "";
                  item2.Sub_OtOptRlt = "";
                });
              console.log(
                item.filter((list) => list.Rever_Sub == option4.Sub_ID)
              );
            } else if (item1.check != "未戒酒") {
              document.body
                .querySelectorAll(`#tt${item1.Sub_ID}`)
                .forEach((item) => {
                  item.style.display = "";
                });
            }
          } 
        });
      });
      sessionStorage.setItem("wd", JSON.stringify(this.user.jkwd));
      console.log("store", this.user.jkwd);
      console.log("option4", option4);
      console.log(option1, option2, option3, option4);
    },
    onuser1(val) {
      console.log("val", val);
      this.user.jkwd.forEach((item) => {
        item.forEach((item1) => {
          if (item1.Sub_Name == val[0].Sub_Name) {
            item1.check = "";
          }
          if (
            item1.Sub_Name == val[0].Sub_Name &&
            item1.Sub_ID == val[0].Sub_ID
          ) {
            item1.check == "";
            item
              .filter((list) => list.Rever_Sub == val[0].Sub_ID)
              .forEach((item2) => {
                item2.check = "";
              });
          }
        });
      });
      sessionStorage.setItem("wd", JSON.stringify(this.user.jkwd));
    },
    getDD() {
      var obj1 = {},
        newArr1 = [];
      console.log("cnm", this.dds);
      this.dds.forEach(function (item, suffix) {
        //根据对象的属性是唯一的，将值作为对象的属性名
        if (!obj1[item.Sub_TypeName]) {
          var arr1 = [];
          arr1.push(item);
          newArr1.push(arr1);
          obj1[item.Sub_TypeName] = item;
        } else {
          newArr1.forEach(function (value, index) {
            //如果已经存在  就循环新组的值将值插入属性相同的数组里   为了防止重复添加   只要和第一个比较就可以了
            if (value[0].Sub_TypeName == item.Sub_TypeName) {
              value.push(item);
            }
          });
        }
      });
      this.dd = newArr1;
      this.dd.forEach((item) => {
        item.forEach((item1) => {
          if (item1.Val_Type == "1") {
            item1.check = item1.Val_Def;
          } else if (item1.Val_Type == "0" && item1.Val_SctMode == "2") {
            item1.check = item1.Val_Def;
          } else if (item1.Val_Type == "0" && item1.Val_SctMode == "0") {
            item1.check = item1.Val_Def;
          } else if (item1.Val_Type == "0" && item1.Val_SctMode == "1") {
            var def = item1.Val_Def.split(",");
            item1.checkedlist = def;
          }
        });
      });
      console.log("this.dd",this.dd)
      // this.dd.forEach((item)=>{
      //   item.forEach((item1)=>{
      //     this.dd.forEach((item2)=>{
      //       item2.forEach((item3)=>{
      //         console.log("item3.check",item3.check)
      //         if(item1.Sub_ID==item3.Rever_Sub){
      //           if(item1.check==item3.Rever_Val){
      //             console.log("4321",  document.body.querySelectorAll(`#tt${item1.Sub_ID}`))
      //               document.body
      //           .querySelectorAll(`#tt${item1.Sub_ID}`)
      //           .forEach((item) => {
      //             item.style.display = "none";
      //           });
      //             item
      //         .filter((list) => list.Rever_Sub == item3.Rever_Sub)
      //         .forEach((item4) => {
      //           item4.check = "";
      //           item4.checkedlist = "";
      //           item4.Sub_OtOptRlt = "";
      //         });
      //           }
      //         }else if(item1.check!=item3.Rever_Val){
      //             document.body
      //           .querySelectorAll(`#tt${item1.Sub_ID}`)
      //           .forEach((item) => {
      //             item.style.display = "";
      //           });
      //         }
      //       })
      //     })
      //   })
      // })
      console.log("456");
      console.log(this.dd);
    },
    getdd(){
      this.user.jkwd.forEach((item)=>{
        item.forEach((item1)=>{
          this.user.jkwd.forEach((item2)=>{
            item2.forEach((item3)=>{
              if(item1.Sub_ID==item3.Rever_Sub&&item1.check==item3.Rever_Val){
                  item2
                .filter((list) => list.Rever_Sub == item1.Sub_ID)
                .forEach((item2) => {
                  document.body.querySelectorAll(`#tt${item2.Rever_Sub}`).forEach((item)=>{
                item.style.display="none"
               })
                });
              }
            })
          })
        })
      })
//  this.user.jkwd.forEach((item)=>{
//         item.forEach((item1)=>{
//           this.user.jkwd.forEach((item2)=>{
//             item2.forEach((item3)=>{
//               // console.log("item3.check",item3.check)
//               if(item1.Sub_ID==item3.Rever_Sub&&item1.Val_Type=="0"&& item1.Val_SctMode=="0"){
//                 if(item1.check==item3.Rever_Val){
//                   console.log("4321",  document.body.querySelectorAll(`#ttd${item1.check}`))
//                     document.body
//                 .getElementsByClassName(`tt${item1.Sub_ID}`)
//                 .forEach((item) => {
//                   item.style.display = "none";
//                 });
//                   item
//               .filter((list) => list.Rever_Sub == item3.Rever_Sub)
//               .forEach((item4) => {
//                 item4.check = "";
//                 item4.checkedlist = "";
//                 item4.Sub_OtOptRlt = "";
//               });
//                 }
//               }else if(item1.check!=item3.Rever_Val){
//                   document.body
//                 .querySelectorAll(`#tt${item1.Sub_ID}`)
//                 .forEach((item) => {
//                   item.style.display = "";
//                 });
//               }
//             })
//           })
//         })
//       })
    },
    getlist() {
      var obj1 = {},
        newArr1 = [];
      this.lists.forEach(function (item, suffix) {
        //根据对象的属性是唯一的，将值作为对象的属性名
        if (!obj1[item.Sub_ID]) {
          var arr1 = [];
          arr1.push(item);
          newArr1.push(arr1);
          obj1[item.Sub_ID] = item;
        } else {
          newArr1.forEach(function (value, index) {
            //如果已经存在  就循环新组的值将值插入属性相同的数组里   为了防止重复添加   只要和第一个比较就可以了
            if (value[0].Sub_ID == item.Sub_ID) {
              value.push(item);
            }
          });
        }
      });
      this.ed = newArr1;
      // this.user.jkwd.forEach((item) => {
      //   console.log("aaa", item);
      //   item.forEach((item1) => {
      //     this.ed.forEach((item2) => {
      //       item2.forEach((item3) => {
      //         if (item1.Val_Type == "1") {
      //           item1.check = item1.Val_Def;
      //         } else if (item1.Val_Type == "0" && item1.Val_SctMode == "2") {
      //           item1.check = item1.Val_Def;
      //         } else if (
      //           item1.Val_Type == "0" &&
      //           item1.Val_SctMode == "0" &&
      //           item1.Sub_ID == item3.Sub_ID
      //         ) {
      //           item1.check = item1.Val_Def;

      //         } else if (
      //           item1.Val_Type == "0" &&
      //           item1.Val_SctMode == "1" &&
      //           item1.Sub_ID == item3.Sub_ID
      //         ) {
      //           var def = item1.Val_Def.split(",");
      //           item1.checkedlist = def;
      //         }
      //       });
      //     });
      //   });
      // });
      console.log("eedd", this.ed);
    },
    removeExtraFields() {
      this.dds = this.wtlist.map((item) => ({
        Sub_ID: item["Sub_ID"],
        Sub_TypeID: item["Sub_TypeID"],
        Sub_TypeName: item["Sub_TypeName"],
        Sub_Rank: item["Sub_Rank"],
        check: "",
        check1: "",
        Rever_Sub: item["Rever_Sub"],
        Rever_Val: item["Rever_Val"],
        Val_Def: item["Val_Def"],
        Val_Type: item["Val_Type"],
        Val_SctMode: item["Val_SctMode"],
        Sub_Name: item["Sub_Name"],
        checkedlist: new Array(),
        Sub_OtOptID: "",
        Sub_OtOptRlt: item["Val_OtValue"],
        Val_OtOpts: item["Val_OtOpts"],
        Sub_SysType:item['Sub_SysType']
      }));
      console.log(this.dds);
      this.mms = this.wtlist.map((item) => ({
        [this.keepField]: item[this.keepField],
        [this.keepField2]: item[this.keepField2],
        Opt_Score: "",
        User_Code: this.User_Code,
        Interface_Code: this.Interface_Code,
        Check_No: "01",
        Tz_Id: item["Tz_Id"],
        Tz_Name: item["Tz_Name"],
        Opt_ID: "",
      }));
    },
    handleFocus() {
      // 键盘弹出事件，根据实际情况可能需要自定义
      this.scale = 1;
    },
    handleBlur() {
      // 键盘收起事件，恢复缩放比例
      this.scale = 1;
    },
    handleGoKey(event) {
      // 关闭软键盘的示例代码
      if (event.key === "Enter") {
        event.target.blur();
      } // 假设你的input元素有ref="input"
    },
    set() {
      this.$router.replace("/ewm");
    },
    getyclists() {
      var obj4 = {},
        newArr4 = [];
      this.wtlist.forEach(function (item, suffix) {
        //根据对象的属性是唯一的，将值作为对象的属性名
        if (!obj4[item.Sub_TypeName]) {
          var arr4 = [];
          arr4.push(item);
          newArr4.push(arr4);
          obj4[item.Sub_TypeName] = item;
        } else {
          newArr4.forEach(function (value, index) {
            //如果已经存在  就循环新组的值将值插入属性相同的数组里   为了防止重复添加   只要和第一个比较就可以了
            if (value[0].Sub_TypeName == item.Sub_TypeName) {
              value.push(item);
            }
          });
        }
      });
      this.ue = newArr4;
      console.log(this.ue);
    },
    getwt() {
      axios
        .post(
          window.globalUrl.server + "Service.asmx/Get_User_QueSuggSubs",
          JSON.stringify({
            User_Code: this.User_Code,
            Interface_Code: this.Interface_Code,
            Check_No: this.user.xqlist1.Check_No,
            Pson_Name: this.user.xqlist1.Pson_Name,
            Check_Date: this.user.xqlist1.Check_Date,
            Pson_Age: this.user.xqlist1.Pson_Age,
            Pson_Sex: this.user.xqlist1.Pson_Sex,
            Pson_Tel: this.user.xqlist1.Pson_Tel,
            Pson_CardID: this.user.xqlist1.Pson_CardID,
            Pson_Addr: this.user.xqlist1.address,
            Pson_Tag: this.user.xqlist1.Pson_Tag,
            Check_Package: "",
            Check_Site: this.user.xqlist1.Site_ID,
          })
        )
        .then((res) => {
          if (res.data.RltCode == 1) {
            console.log("ddd", res);
            console.log("1nnnnnnnnnnn", JSON.parse(res.data.RltData));
            this.wtlist = JSON.parse(res.data.RltData);
            this.getyclists();
            this.removeExtraFields();
            this.getDD();
            console.log("bb");
            this.dd = JSON.parse(sessionStorage.getItem("wd"))
              ? JSON.parse(sessionStorage.getItem("wd"))
              : this.dd;
            sessionStorage.setItem("wd", JSON.stringify(this.dd));
            console.log(this.dd);
            this.user.jkwd = this.dd;
            console.log(this.ue);
            axios
              .post(
                window.globalUrl.server +
                  "Service.asmx/Get_User_QueSuggSub_Opts",
                JSON.stringify({
                  User_Code: this.User_Code,
                  Interface_Code: this.Interface_Code,
                  Check_No: this.user.xqlist1.Check_No,
                  Pson_Name: this.user.xqlist1.Pson_Name,
                  Check_Date: this.user.xqlist1.Check_Date,
                  Pson_Age: this.user.xqlist1.Pson_Age,
                  Pson_Sex: this.user.xqlist1.Pson_Sex,
                  Pson_Tel: this.user.xqlist1.Pson_Tel,
                  Pson_CardID: this.user.xqlist1.Pson_CardID,
                  Pson_Addr: this.user.xqlist1.address,
                  Pson_Tag: this.user.xqlist1.Pson_Tag,
                  Check_Package: "",
                  Check_Site: this.user.xqlist1.Site_ID,
                })
              )
              .then((res) => {
                console.log(JSON.parse(res.data.RltData));
                this.lists = JSON.parse(res.data.RltData);
                this.getlist();
                console.log(this.lists);
                console.log("老子", this.ed);
              });
          }
        });
    },
  },
  computed: {
    sss(){
        return(u)=>{
            this.wtlist.filter((list)=>list.Rever_Sub==u.Sub_ID)
        }
    },
    getUserPosts() {
      this.getlist();
      console.log(this.ed);
      return (u) => {
        return this.lists.filter((list) => list.Sub_Name === u.Sub_Name);
      };
    },
    getUserPosts1() {
      this.getlist();
      console.log(this.ed);
      return (u) => {
        return this.lists.filter((list) => list.Sub_Name === u.Sub_Name)[0];
      };
    },
    getft() {
      return (u) => {
        return this.user.jkwd.filter(lists[u]);
      };
    },
  },
  created() {
    this.Interface_Code = sessionStorage.getItem("item");
    this.User_Code = JSON.parse(sessionStorage.getItem("UserInfo")).sUser_Code;
    this.user = userStore();
    this.dd = JSON.parse(sessionStorage.getItem("wd"));
    console.log(this.user.jkwd);
    this.getshow();
    this.getwt();
  },
  mounted() {
    window.scrollTo(0, 0);
    console.log("mmmm",document.body.querySelectorAll("#tt520011"))
       this.getdd()
 },
};
</script>

<style scoped>
.s1 {
  width: 50px;
  text-align: center;
  font-size: 16px;
  line-height: 100px;
}
.q1 {
  display: flex;
  align-content: center;
  justify-items: center;
}
.q2 {
  display: flex;
  align-content: center;
  justify-items: center;
  margin-left: 72px;
}
.q3 {
  display: flex;
  align-content: center;
  justify-items: center;
  margin-left: 72px;
}
.el-col-12,
.el-col-12.is-guttered {
  width: 35px;
}
/* .cross-input-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cross-icon {
  width: 40px;
  height: 80px;
  background: url("path_to_your_cross_icon_image.png");
  background-repeat: no-repeat;
  background-position: center;
} */

.cross-input {
  width: 70px;
  height: 50px;
  border: 1px solid black;
  /* border-radius: 5px; */
  text-align: center;
  font-size: 12px;
}
.qc {
  display: flex;
}
::v-deep .el-dialog__headerbtn .el-dialog__close {
  color: red;
  font-size: inherit;
}
::v-deep .mmg {
  width: 28px;
  height: 28px;
}
::v-deep .container-title {
  height: auto;
  padding-left: 0;
  background-color: #7baafa;
}
.bbbn {
  /* margin-left: 20px; */
  width: 40px;
  height: 20px;
}
.tab {
  /* width: 100%; */
  position: fixed;
  right: 0;
  z-index: 0;
}
.tabd {
  width: 100%;
  display: flex;
  justify-items: center;
  align-items: center;
}
.tab-list {
  width: 100%;
  justify-content: center;
  display: flex;
  align-items: center;
  /* border: 1px solid; */
}
::v-deep .van-switch {
  font-size: 20px;
}
::v-deep #taa3 {
  /* padding-bottom: 40px; */
}
::v-deep .taa {
  padding: 40px 0px;
}
::v-deep .el-button {
  /* width: 100%; */
}
::v-deep .el-table--fit {
  z-index: 0;
}
::v-deep .el-table .cell {
  display: flex;
  justify-content: center;
}
.s-h3 {
  font-size: 16px;
}
h3 {
  font-size: 17px;
  font-weight: 600;
}
::v-deep .van-field__body {
  border-bottom: 0px solid;
}
::v-deep .van-field {
  border-bottom: 1px solid;
}
::v-deep .van-checkbox__label {
  display: flex;
}
::v-deep .van-cell-group {
  display: flex;
  align-items: center;
  height: 35px;
  /* margin-top: 10px;
  margin-bottom: 10px; */
}
::v-deep .van-radio {
  /* margin-top: 10px; */
  margin-right: 15px;
}
::v-deep .van-checkbox {
  /* margin-top: 10px;
  margin-right: 15px; */
  margin-right: 15px;
}
.ix {
  height: 100%;
}
.dd {
  display: flex;
  align-items: center;
  height: 35px;
  /* margin-top: 10px;
  margin-left: 10px; */
}
.dddd {
  display: flex;
  justify-content: center;
  align-items: center;
}
.dds {
  display: flex;
  align-items: center;
  height: 35px;
  /* margin-left: 20px; */
}
.pp {
  font-size: 16px;
  height: 30px;
  line-height: 30px;
  width: 100%;
}
.ppp {
  width: 100%;
}
.input {
  font-family: Tahoma, Arial, 宋体;

  font-size: 16px;
  height: 20px;

  line-height: 20px;

  color: #000000;

  border-top-style: none;

  border-right-style: none;

  border-bottom-style: dashed;

  border-left-style: none;

  border-bottom-color: #000000;

  border-top-width: 0px;

  border-right-width: 0px;

  border-bottom-width: 1px;

  border-left-width: 0px;
}
::v-deep .van-cell-group {
  background: var(--van-cell-group-background);
  /* margin-right: 20px; */
}
.tt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  height: 100%;
}
.tts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  height: 100%;
  /* padding-top: 10px;
  padding-bottom: 20px; */
  font-size: 16px;
}
.ttd {
  display: flex;
  align-items: center;
  /* padding-top: 10px; */
  /* padding-bottom: 10px; */
}
.ddd {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rank_title {
  border-bottom: 1px solid;
  /* padding-bottom: 5px; */
  /* padding-top:30px ; */
}
.rank_box {
  height: 100%;
  /* padding-top:30px ; */
}
.tabs {
  display: flex;
  /* border: 1px solid red; */
  position: fixed;
  top: 0;
  left: 300px;
}

.img1 {
  width: 20px;
  height: 20px;
  margin-left: 10px;
}
.s-title {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid burlywood;
  /* padding-bottom: 5px; */
}
input {
  border: 1px solid;
  width: 200px;
}
.t1 {
  display: flex;
  margin-top: 2px;
  height: 17px;
  /* width: 280px; */
}
.container {
  display: flex;
  height: 100vh; /* 全屏高度 */
}

.fixed-sidebar {
  width: 280px; /* 左边部分宽度 */
  background-color: #4486f8;
  /* display: flex; */
  /* height: 100vh; */
  padding: 10px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  /* justify-content: center;
    align-items: center;
    flex-direction: column; */
  /* 背景色 */
}

.scrollable-content {
  flex: 1; /* 可伸缩，占据剩余空间 */
  /* overflow-y: auto;  */
  /* padding: 10px; */
  height: 2145px;
  padding-left: 290px;
  /* padding-top: 30px; */
}
.sidebar-content1 {
  width: 100%;
  padding: 5px;
  height: 180px;
  background-color: #7baafa;
  border-radius: 0px;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
  /* margin-left: 12px; */
  border-radius: 5px;
}
.sidebar-content2 {
  width: 100%;
  padding: 3px 5px;
  margin-top: 20px;
  height: 200px;
  background-color: #7baafa;
  border-radius: 0px;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
  /* margin-left: 12px; */
  border-radius: 5px;
}
.content2-nent {
  /* width: 280px; */
}
.sidebar-content3 {
  width: 100%;
  padding: 5px;
  height: 45px;
  margin-top: 20px;
  background-color: #7baafa;
  border-radius: 0px;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
  /* margin-left: 12px; */
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.st {
  padding: 10px;
}
h2 {
  font-size: 20px;
  font-weight: 900;
}
h5 {
  line-height: 28px;
}
p {
  font-size: 16px;
  margin-left: 5px;
}
::v-deep .messageBox .el-button > span {
  font-size: 16px !important;
  justify-content: center;
  display: flex;
  align-items: center;
}
::v-deep span {
  margin: 0;
}

@media screen and (orientation: portrait) {
  .portrait {
    /* 竖屏样式 */
  }
  ::v-deep .t1 {
    display: flex;
    margin-top: 6px;
    height: 14px;
    /* width: 280px; */
  }
  .fixed-sidebar {
    width: 35%; /* 左边部分宽度 */
    background-color: #4486f8;
    /* display: flex; */
    height: 700px;
    padding: 8px;
    z-index: 1;
    /* justify-content: center;
                            align-items: center;
                            flex-direction: column; */
    /* 背景色 */
  }
  p {
    font-size: 12px;
  }
  ::v-deep .sidebar-content1 {
    width: 100%;
    padding: 10px;
    height: 220px;
    background-color: #7baafa;
    border-radius: 0px;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);

    border-radius: 5px;
  }
  ::v-deep .sidebar-content2 {
    width: 100%;
    padding: 10px;
    margin-top: 20px;
    height: 270px;
    background-color: #7baafa;
    border-radius: 0px;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
    border-radius: 5px;
  }
  ::v-deep .sidebar-content3 {
    width: 100%;
    padding: 10px;
    height: 100px;
    margin-top: 20px;
    background-color: #7baafa;
    border-radius: 0px;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
    border-radius: 5px;
  }
  ::v-deep h2 {
    font-size: 25px;
    font-weight: 900;
  }
  .scrollable-content {
    flex: 1; /* 可伸缩，占据剩余空间 */
    overflow-y: auto; /* 滚动条 */
    padding: 10px;
    height: 3345px;
    padding-left: 35%;
  }
  ::v-deep .tabs {
    display: flex;
    /* border: 1px solid red; */
    position: fixed;
    top: 0;
    left: 400px;
  }
  ::v-deep .pp {
    font-size: 25px;
    height: 35px;
    line-height: 35px;
  }
  ::v-deep .el-table .cell {
    font-size: 12px;
  }
}
</style>
